package com.javabean;

/*
    Game游戏类
        游戏名称 name
        发行公司 developer
        发行时间 date
        游戏类型 type
        游戏人数 players
        游戏画面 gameScreen
 */
public class Game {
    //1.成员变量-->必须私有
    //满足封装的思想,将代码的具体细节隐藏起来,不让外界进行随便访问
    //体现:方法提高复用性  private 提高安全性
    private String name;
    private String developer;
    private String date;
    private String type;
    private int player;
    private String gameScreen;

    //2.构造方法,提供两种

    //无参构造
    public Game() {

    }
    //带参构造

    public Game(String name, String developer, String date, String type, int player, String gameScreen) {
        this.name = name;
        this.developer = developer;
        this.date = date;
        this.type = type;
        this.player = player;
        this.gameScreen = gameScreen;
    }

    //由于封装思想,被private修饰的成员变量,外界无法直接访问,所哟提供get和set方法进行操作

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDeveloper() {
        return developer;
    }

    public void setDeveloper(String developer) {
        this.developer = developer;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getPlayer() {
        return player;
    }

    public void setPlayer(int player) {
        this.player = player;
    }

    public String getGameScreen() {
        return gameScreen;
    }

    public void setGameScreen(String gameScreen) {
        this.gameScreen = gameScreen;
    }

    //成员方法,两个明确 1.参数列表 2.返回值类型
    //show展示属性的信息
    public void show() {
        /*
    Game游戏类
        游戏名称 name
        发行公司 developer
        发行时间 date
        游戏类型 type
        游戏人数 players
        游戏画面 gameScreen
 */
        System.out.println("游戏名称:" + name);
        System.out.println("发行公司:" + developer);
        System.out.println("发行时间:" + date);
        System.out.println("游戏类型:" + type);
        System.out.println("游戏人数:" + player);
        System.out.println("游戏画面:" + gameScreen);
    }
}
